{include file="header.html"}
<script type="text/javascript">
$(function(){
    $('#recommendation_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        onkeyup    : false,
        rules : {
            cate_name : {
                required : true
            },
            cate_desc : {
                required : true
            },
            sort_order : {
                number   : true
            }
        },
        messages : {
            cate_name : {
                required : '{$lang.cate_name_desc}'
            },
            cate_desc : {
                required : '{$lang.limit_cate_desc}'
            },
            sort_order  : {
                number   : '{$lang.number_only}'
            }
        }
    });
});
</script>
<div id="rightTop">
    <p>{$lang.recom_cate}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=recom_cate">{$lang.manage}</a></li>
        {if $cfg.recommendation_id}
        <li><a class="btn1" href="index.php?app=recom_cate&amp;act=add">{$lang.add}</a></li>
        {else}
        <li><span>{$lang.add}</span></li>
        {/if}
        <li><a class="btn1" href="index.php?app=recom_cate&wait_verify=1">{$lang.wait_verify}</a></li>
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="recommendation_form">
        <input id="cate_id" type="hidden" name="cate_id" value="{$recom.cate_id}" />
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.cate_name}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="cate_name" type="text" name="cate_name" value="{$recom.cate_name|escape}" /> <label class="field_notice">{$lang.cate_name_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.cate_text}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="text" type="text" name="text" value="{$recom.text|escape}" /> <label class="field_notice">{$lang.cate_text_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.cate_key_words}:</th>
                <td class="paddingT15 wordSpacing5">
                    <textarea style="height: 50px;" id="key_words" name="key_words">{$recom.key_words|escape}</textarea> <label class="field_notice">{$lang.cate_key_words_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.cate_desc}:</th>
                <td class="paddingT15 wordSpacing5">
                    <textarea id="cate_desc" name="cate_desc">{$recom.cate_desc|escape}</textarea>
                    <label class="field_notice">{$lang.limit_cate_desc}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.if_recommended}:</th>
                <td class="paddingT15 wordSpacing5">
                {html_radios options=$yes_or_no checked=$recom.if_show name=if_show}</td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.sort_order}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="sort_order" type="text" name="sort_order" value="{$recom.sort_order}" />
                    <label class="field_notice">{$lang.update_order}</label>
                </td>
            </tr>
        <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
